Error while following along with the Regression - Training and Testing section
While following the Regression - Training and Testing section, the following line of code
X_train, X_test, y_train, y_test = cross_validation.train_test_split(X, y, test_size=0.2)
gives an error : ValueError: Found arrays with inconsistent numbers of samples: [2966 2967] I suspect it comes from this line
X = X[:-forecast_out+1]
You must be logged in to post. Please login or register an account.
Not sure what that was there for. I've updated the tutorial, but it was both that line you thought, as well as moving a dropna call. If you ever want answers faster, you can check the associated videos to see what is different. I run the code in the videos, so, if there is an error, it'll come up, and if there isn't an error, you'll know maybe you made a typo or mistake on your end.
Thanks for pointing this out!
-Harrison 8 years ago
You must be logged in to post. Please login or register an account.